<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:PropertyTools.Wpf">
    <local:NullToVisibilityConverter x:Key="NullToVisibilityConverter" NullVisibility="Collapsed"/>

    <Style TargetType="{x:Type local:FilePicker}">
        <Setter Property="MinWidth" Value="30" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:FilePicker}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <TextBox Text="{Binding FilePath, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}" />
                        <Button Grid.Column="1" MinWidth="40" Margin="4 0 0 0" 
                                Visibility="{TemplateBinding BrowseButtonContent, Converter={StaticResource NullToVisibilityConverter}}" 
                                Content="{TemplateBinding BrowseButtonContent}" 
                                ToolTip="{TemplateBinding BrowseButtonToolTip}" 
                                Command="{Binding BrowseCommand,RelativeSource={RelativeSource TemplatedParent}}" 
                                />
                        <Button Grid.Column="2" MinWidth="40" Margin="4 0 0 0" 
                                Visibility="{TemplateBinding ExploreButtonContent, Converter={StaticResource NullToVisibilityConverter}}" 
                                Content="{TemplateBinding ExploreButtonContent}" 
                                ToolTip="{TemplateBinding ExploreButtonToolTip}" ToolTipService.ShowOnDisabled="True"
                                Command="{Binding ExploreCommand,RelativeSource={RelativeSource TemplatedParent}}" 
                                />
                        <Button Grid.Column="3" MinWidth="40" Margin="4 0 0 0" 
                                Visibility="{TemplateBinding OpenButtonContent, Converter={StaticResource NullToVisibilityConverter}}" 
                                Content="{TemplateBinding OpenButtonContent}" 
                                ToolTip="{TemplateBinding OpenButtonToolTip}" ToolTipService.ShowOnDisabled="True"
                                Command="{Binding OpenCommand,RelativeSource={RelativeSource TemplatedParent}}" 
                                />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:DirectoryPicker}">
        <Setter Property="MinWidth" Value="30" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:DirectoryPicker}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <TextBox 
                            Text="{Binding Directory, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}" />
                        <Button Grid.Column="1" MinWidth="40" Margin="4 0 0 0" 
                                Visibility="{TemplateBinding BrowseButtonContent, Converter={StaticResource NullToVisibilityConverter}}" 
                                Content="{TemplateBinding BrowseButtonContent}" 
                                ToolTip="{TemplateBinding BrowseButtonToolTip}" 
                                Command="{Binding BrowseCommand,RelativeSource={RelativeSource TemplatedParent}}" />
                        <Button Grid.Column="2" MinWidth="40" Margin="4 0 0 0"
                                Visibility="{TemplateBinding ExploreButtonContent, Converter={StaticResource NullToVisibilityConverter}}" 
                                Content="{TemplateBinding ExploreButtonContent}" 
                                ToolTip="{TemplateBinding ExploreButtonToolTip}" ToolTipService.ShowOnDisabled="True"
                                Command="{Binding ExploreCommand,RelativeSource={RelativeSource TemplatedParent}}"  />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>